Deleted unused files.
[Sonic-Engine-360.git] / GMS2 / Sonic Engine 360 / objects / BoxParent / Step_1.gml
blob1d5d0c3a1e9ecbb08bde1e4c2af39eeacfc523d1
1 /// Box collision checks\r
2 \r
3 var vspd_set;\r
4 \r
5 with (Player)       // Note with all items, the code is used in the items but it runs through inside the Player\r
6 {\r
7     if (action == act_death || point_distance(x, y, other.x, other.y) > 100) continue;  // Don't run through code if Player is dead or too far away\r
8 \r
9     // Set solid if Player isn't rolling and the box isn't destroyed (set non-solid otherwise)\r
10     other.solid = (action != act_roll && other.action == 0);\r
12     // Only execute hit action if non-solid and a collision is going to occur\r
13     if (other.solid == false && collision_onset(other.id) && other.action == 0)\r
14     {\r
15         if (full_vspeed > 0)   // If the Player is moving downwards then going to bounce off the box\r
16         {\r
17             vspd_set = full_vspeed*-other.bounce_factor;    // Get the vspeed to bounce up at (note this is dependent on the Player's original vspeed)\r
18             vsp = vspd_set;                                 // Now set the Player vspeed to this value\r
19         }\r
20         other.action = 1;                     // Set the box action to 1 to show it has been destroyed\r
21         player_box_action(other.box_type);    // Script to make the box powerup action occur   \r
22     }\r
23 }\r